<?php

class Upload extends Controller {
	
	function Upload()
	{
		parent::Controller();
	}
	
	function index()
	{	
		$config['upload_path'] = './uploads/';
		$config['allowed_types'] = 'txt|lst|map';
		$config['max_size']	= '100';
		
		$this->load->library('upload', $config);
		
		$fields = array("stashfile", "mapfile", "charfile");
		
		foreach ($fields as $field)
		{
			if (!$this->upload->do_upload($field))
			{
				$error = array('error' => $this->upload->display_errors());
			}	
			else
			{
				$data = array('upload_data' => $this->upload->data($field));
			}
		}
	}
}
?>